package cn.bone.demo01.controller;

import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import redis.clients.jedis.Jedis;

import javax.annotation.Resource;

@RestController
public class DemoController {

    @Resource(name = "stringRedisTemplate")
    private StringRedisTemplate redisTemplate;

    @RequestMapping("/set")
    public String set(){

        redisTemplate.opsForValue().set("name","cyl");




        return "ok";
    }

    @RequestMapping("/get")
    public String get(){
        String name = redisTemplate.opsForValue().get("name");
        return name;
    }

    public void jedis(){
        Jedis jedis = new Jedis();
    }
}
